import 'package:dio/dio.dart';

import 'package:retrofit/dio.dart';
import 'package:retrofit/http.dart';
import '../lib/core/http/dior.dart';

part '${NAME}.g.dart';

@RestApi(baseUrl: '')
abstract class ${CLASS_NAME} {
  static final _cache = <String, ${CLASS_NAME}>{};

  static ${CLASS_NAME} acquire() {
    return ${CLASS_NAME}(Dior.appDio);
  }

  factory ${CLASS_NAME}(Dio dio, {String baseUrl}) {
    return _cache.putIfAbsent(baseUrl, () {
    return _${CLASS_NAME}(dio, baseUrl: baseUrl);
    });
  }

  @POST("/example/post")
  Future<void> methodName({
    @DioOptions() Options options,
    @CancelRequest() CancelToken cancelToken,
    @SendProgress() ProgressCallback onSendProgress,
    @ReceiveProgress() ProgressCallback onReceiveProgress,
    @Field("field0") int field0,
    @Field("field1") int field1,
  });
}
